package fem2.mesh_and_topology;

/**
 * interface for checking spatial criteria in space
 * 
 * @author hbui
 * 
 */
public abstract class SpatialCriteria {

	/**
	 * check if spatial criteria is satisfied
	 * 
	 * @param x
	 * @return true if point x satisfy spatial criteria; false if x does not
	 */
	public abstract boolean isSatisfied(double... x);

	/**
	 * collision checking with a square (using in quad tree indexing)
	 * 
	 * the square is specified by (x0,y0)--(x0+size,y0+size)
	 * 
	 * @param x0
	 * @param y0
	 * @param size
	 * @return
	 */
	public boolean isIntersected(double x0, double y0, double size) {
		throw new Error("to use with the quad, you must derive this method");
	}

	/**
	 * collision checking with a box (using in quad tree indexing)
	 * 
	 * the box is specified by (x0,y0,z0)--(x0+size,y0+size,z0+size)
	 * 
	 * @param x0
	 * @param y0
	 * @param z0
	 * @param size
	 * @return
	 */
	public boolean isIntersected(double x0, double y0, double z0, double size) {
		throw new Error("to use with the oct, you must derive this method");
	}
}
